<?php

namespace App\Events\OpenShop;

use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class GenerateHeatMapImageEvent
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    /**
     * Create a new event instance.
     *
     * @return void
     */

    public string $backgroundPath = '';  //背景图片
    public float  $lat            = 0;   //纬度
    public float  $lng            = 0;   //经度
    public int    $siteLocationId = 0;   //选址表单ID

    public function __construct($lng, $lat, $backgroundPath, $siteLocationId)
    {
        $this->lng            = $lng;
        $this->lat            = $lat;
        $this->backgroundPath = $backgroundPath;
        $this->siteLocationId = $siteLocationId;
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return \Illuminate\Broadcasting\Channel|array
     */
    public function broadcastOn()
    {
        return new PrivateChannel('channel-name');
    }
}
